﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public sealed partial class NetworkManager : NetworkProcessMain
{
	public void C2S_FRIEND_SEARCH(string name, System.Action<ResponseModel<FriendModel>> Callback)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<FriendModel>);
		msg.IsShowError = false;
		
		PT_C2S_FRIEND_SEARCH dataPush = new PT_C2S_FRIEND_SEARCH();
		dataPush.Reset();
		
		dataPush.name = name;
		dataPush.PushData(ref msg);
		
		PushPacketToTrasmitQue(msg);
	}

	/*
	 * TODO: (친구 검색 목록 결과가 여러개 였을 때의 매소드 : 다시 이것으로 바뀔 수 있어서 남겨둠)
	 * 
	public void C2S_FRIEND_SEARCH(string name, System.Action<ResponseModel<List<FriendModel>>> Callback)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<List<FriendModel>>);
		msg.IsShowError = false;
		
		PT_C2S_FRIEND_SEARCH dataPush = new PT_C2S_FRIEND_SEARCH();
		dataPush.Reset();
		
		dataPush.name = name;
		dataPush.PushData(ref msg);
		
		PushPacketToTrasmitQue(msg);
	}
	*/

	public void C2S_FRIEND_LIST(int[] type, System.Action<ResponseModel<List<FriendModel>>> Callback)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<List<FriendModel>>);
		msg.IsShowError = false;
		
		PT_C2S_FRIEND_LIST dataPush = new PT_C2S_FRIEND_LIST();
		dataPush.Reset();
		
		dataPush.t = type;
		dataPush.PushData(ref msg);
		
		PushPacketToTrasmitQue(msg);
	}

	public void C2S_FRIEND_SEND_REQ(long id, System.Action<ResponseModel<object>> Callback)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<object>);
		msg.IsShowError = false;
		
		PT_C2S_FRIEND_SEND_REQ dataPush = new PT_C2S_FRIEND_SEND_REQ();
		dataPush.Reset();

		dataPush.id = id;
		dataPush.PushData(ref msg);

		PushPacketToTrasmitQue(msg);
	}

	public void C2S_FRIEND_RM(long id, System.Action<ResponseModel<object>> Callback)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<object>);
		msg.IsShowError = false;
		
		PT_C2S_FRIEND_RM dataPush = new PT_C2S_FRIEND_RM();
		dataPush.Reset();

		dataPush.id = id;
		dataPush.PushData(ref msg);

		PushPacketToTrasmitQue(msg);
	}

	public void C2S_FRIEND_SEND_REQ_REMOVE(long id, System.Action<ResponseModel<object>> Callback)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<object>);
		msg.IsShowError = false;
		
		PT_C2S_FRIEND_SEND_REQ_REMOVE dataPush = new PT_C2S_FRIEND_SEND_REQ_REMOVE();
		dataPush.Reset();

		dataPush.id = id;
		dataPush.PushData(ref msg);

		PushPacketToTrasmitQue(msg);
	}

	public void C2S_FRIEND_REQ_ACCEPT(long id, int type, System.Action<ResponseModel<object>> Callback)
	{
		NetMsg msg = new NetMsg();
		msg.Reset();
		msg.CallbackAck = Callback;
		msg.Type = typeof(ResponseModel<object>);
		msg.IsShowError = false;
		
		PT_C2S_FRIEND_REQ_ACCEPT dataPush = new PT_C2S_FRIEND_REQ_ACCEPT();
		dataPush.Reset();

		dataPush.id = id;
		dataPush.t = type;
		dataPush.PushData(ref msg);

		PushPacketToTrasmitQue(msg);
	}
}